home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / RAMSES 2.2 / RAMSES 2.2 Extras / M2LibExtra / ScanProfile.DEF < prev    next >
Encoding:
Modula Definition  |  1996-06-21  |  2.9 KB  |  83 lines  |  [TEXT/MEDT]

  1. DEFINITION MODULE ScanProfile;
  2.  
  3.   (*******************************************************************
  4.  
  5.     Module  ScanProfile     (Version 1.0)
  6.  
  7.               Copyright ©1991 by Andreas Fischlin and Swiss
  8.               Federal Institute of Technology Zürich ETHZ
  9.  
  10.       Version written for:
  11.               MacMETH_V3.2    (1-Pass Modula-2 implementation)
  12.  
  13.       Purpose Allows to analyze and to retrieve values from
  14.               the so-called User.Profile to customize the
  15.               user environment.   
  16.               
  17.       Remarks The User.Profile is a simple text file, which
  18.               may edited by means of any text editor.  Typically
  19.               it consists of several sections containing values 
  20.               assocated with particular key words. The EBNF:
  21.               
  22.               START = { section } EOF.
  23.                 section = key {  key [string] value }.
  24.                 key = string.
  25.                 value = string.          
  26.                 string = word | ( "'" charThread "'" ) | ( '"' charThread '"' ).
  27.                 word = char {char}.   char > " " (ASCII ordering)
  28.                 charThread = char {char}.   char >= " " (ASCII ordering)
  29.  
  30.               where
  31.                 visChar = any character > " " (ASCII ordering)
  32.                 EOF means End Of File.
  33.                 
  34.               Example:  2 sections, a "System" and an "Alias" section.
  35.                 The first specifies values (keep, resp. nokeep) for
  36.                 the keys 'Compiler' and 'Editor'.  The second
  37.                 section specifies the string 'MyEdit 1.2' as an
  38.                 alias for the key 'Editor2'.
  39.                 
  40.                 "System"
  41.                   'Compiler'  keep
  42.                   'Editor'    nokeep
  43.                   
  44.                 "Alias"
  45.                   'Editor2'   = 'MyEdit 1.2'
  46.  
  47.       Programming
  48.  
  49.           • Design
  50.               A. Fischlin         6/2/92
  51.  
  52.           • Implementation
  53.               A. Fischlin         6/2/92
  54.  
  55.               
  56.           Swiss Federal Institute of Technology Zurich ETHZ
  57.           Department of Environmental Sciences
  58.           Systems Ecology Group
  59.           ETH-Zentrum
  60.           CH-8092 Zurich
  61.           Switzerland
  62.  
  63.           Last revision of definition:  6/2/92  AF
  64.  
  65.   *******************************************************************)
  66.  
  67.  
  68.   PROCEDURE GetValue(sectionKey, key: ARRAY OF CHAR; skipNextStr: BOOLEAN; 
  69.                      VAR valueStr: ARRAY OF CHAR);
  70.     (* Scan and find in the user profile the section marked with
  71.        sectionKey, then the entry marked with key key, and return the
  72.        next string following the key in valueStr.  In case skipNextStr
  73.        is TRUE, don't return the next, but the second next string.  For
  74.        EBNF see above. *)
  75.  
  76.   PROCEDURE SetProfileName (fn: ARRAY OF CHAR);
  77.     (* Override the profile's current file name with fn *)
  78.   PROCEDURE ResetProfileName;
  79.     (* Resets the profile's file name to its initial default
  80.     'User.Profile' *)
  81.  
  82. END ScanProfile.
  83.